RKG_buttons.gau
Oct 12, 2001 version 1.2
by Robert K. Guy
What's New
__________
V1.2 fixes an error in the order of the bitmap numbers and fixes a minor logic
error. You can now assign '0' as a parameter for any of the panel_id buttons to
reprogram that button to refer to the MAIN_PANEL. This version replaces the
earlier version 1.0 dated 06/19/01 and replaces version 1.1 dated 10/04/01.
The button graphics have been entirely revised so as to be not so visually
similar to other copyrighted material.
A set of buttons gauge for FS2000/CFS2 only.
____________________________________________
This gauge file contains: standard panel switching buttons, NAV/GPS, Autopilot and
Flight Director buttons, hidden buttons, programable On/Off buttons, and programable
toggle switches. The principal feature is that most buttons can have their key_id
reassigned by setting the parameter field (in the panel.cfg) so that a button can
operate any "thing" in MSFS that can respond to a key_id. This gauge set was
designed to replace multiple copies of single button gauges that are hard-coded
and to allow more flexible use of buttons. A second goal was to eliminate the need
to load a large gauge set just to use one button from it.
This gauge set is for FS2000 or CFS2 only, it contains no funky code that prevents
you from playing with it. You may rename it or replace or modify the
graphics. All of the bitmaps used are opaque and the buttons may be
placed on any background bitmap.
All of these buttons share their code and resources - they effectively
become repeaters. When multiple instances of a single button are installed in
a panel all of the instances of that single button share their settings. A setting
on one button is repeated on the other. If a single button is installed
(in a panel) more than once, the parameters of the last instance will be used for
all instances of that button.
Since this is an FS2000 gauge you may install as many instances of a
button as you like. FS2000 regards this as a single gauge and will
maintain one copy in memory but will display multiple copies. FS2000
will not make additional copies of the gauge file in order to display
multiple instances.
Most of these buttons can be reprogrammed by entering a number in the parameter
field. All the buttons have default values which are listed below. No parameter
is needed if the default is appropriate. The result is undefined when any
parameter is not a valid number. Ordinarily, the default will be used if the
parameter is not valid for the button. Very little range checking will be made
on the parameter and no errors will be reported.
Any single button can be installed as may times on as many panels as you need.
Just remember that the parameter of the last instance of that single button
will apply to all instances of that single button.
Examples:
To use a button with the default parameter -
gauge34=RKG_buttons!Copilot_button, 479,70,12
toggles the panel with ident=ANNUNCIATOR2_PANEL (see Copilot_button below).
To use a button with a parameter -
gauge34=RKG_buttons!Copilot_button, 479,70,12,12,32
or
gauge34=RKG_buttons!Copilot_button, 479,70,12, ,32
toggles the panel with ident=32. Note that there are two commas in the example above.
The format is 'xxxx, yyyy, wwww, hhhh, parameter'. When the height is not explicitly
stated a blank field is retained and indicated by consecutive commas.
THE BUTTONS
The following can be reprogrammed with any panel ident (column 2 is the default)
______________________________________________________
RKG_buttons!Annunciator_button toggles the panel with ident=ANNUNCIATOR_PANEL =125
RKG_buttons!Annunciator2_button toggles the panel with ident=ANNUNCIATOR2_PANEL =150
RKG_buttons!Collective_button toggles the panel with ident=COLLECTIVE_PANEL =200
RKG_buttons!Compass_button toggles the panel with ident=COMPASS_PANEL =75
RKG_buttons!Copilot_button toggles the panel with ident=ANNUNCIATOR2_PANEL =150
RKG_buttons!Fuel_button toggles the panel with ident=COLLECTIVE_PANEL =200
RKG_buttons!Gps_button toggles the panel with ident=GPS_PANEL =225
RKG_buttons!IFR_button toggles the panel with ident=IFR_MAIN_PANEL =175
RKG_buttons!Main_button toggles the panel with ident=MAIN_PANEL =0
RKG_buttons!Mini_Controls_button toggles the panel with ident=MINI_CONTROLS_PANEL =100
RKG_buttons!Overhead_button toggles the panel with ident=OVERHEAD_PANEL =250
RKG_buttons!Radio_button toggles the panel with ident=RADIO_STACK_PANEL =50
RKG_buttons!Throttle_button toggles the panel with ident=THROTTLE_PANEL =10
The panel ident can be any valid ident not just those listed above. For example:
This window has an ident of 35. The proper syntax for a button is:
gauge00=RKG_buttons!Overhead_button 10,10,19,,35
This places an Overhead_button on a panel and reprograms the panel_id to 35.
Graphics for the above buttons:
_______________________________
Annunciator_button --- "a1" (text)
Annunciator2_button -- "a2" (text)
Collective_button ---- a big yellow up arrow - the collective makes a helicopter go up
Compass_button ------- pointing to North
Copilot_button ------- a navigation instrument crosshair
Fuel_button ---------- a (blue) drop of fuel
Gps_button ----------- a satellite dish
IFR_button ----------- "ifr" (text)
Main_button ---------- a yoke
Mini_Controls_button - a red right-angle marker (looks like the minicontrol window)
Overhead_button ------ a miniture overhead panel
Radio_button --------- an antenna
Throttle_button ------ a tiny tiny little jet
****************************************************************************
The next button is invisible and can be programmed with any panel ident number.
There are ten buttons, 0..9, and each has a default listed below. For example,
Hidden_Panel_Ident_5_button has a default parameter of 125 and toggles the window
with ident=ANNUNCIATOR_PANEL. The parameter can be any valid panel ident.
________________________________________
RKG_buttons!Hidden_Panel_Ident_0_button
...
RKG_buttons!Hidden_Panel_Ident_9_button
This is a scrap from a panel which illustrates how to use the hidden_panel_ident
button. This panel has no controls on it - it is just a picture of a yoke.
The hidden button forms a hotspot on the bitmap - just click on it and the
window closes. Note that the panel 4 button by default refers to the
mini_controls panel and that no parameter is required.
The very same hidden button (4) could also be installed on the main panel so that
the yoke panel could be opened from the main panel by clicking on a hotspot.
Any single button can be installed as may times on as many panels as you need.
Just remember that the parameter of the last instance of that single button
will apply to all instances of that single button.
The next button is programmed with any panel ident number. There are ten buttons,
0..9, and each has a default the same as the hidden panel button above.
For example, Panel_5_button has a default parameter of 125 and toggles
the panel with an ident=125. The parameter can be any valid panel ident. These
buttons have a text graphic of the number 0 to 9 and are not animated.
___________________________
RKG_buttons!Panel_0_button
...
RKG_buttons!Panel_9_button
The following can be reprogrammed with any key_id.
_________________________________________________
RKG_buttons!Hidden_Key_Id_0_button 0..9 buttons
RKG_buttons!Key_Id_0_button 0..9 buttons
The above buttons are all ON/OFF toggle type buttons. The designed key_ids below
allow the button to toggle their variables and respond to the current state of
their variables. Ordinarily, OFF means a value of 0 and ON means a value of 1.
There is an OFF/ON button that starts out in the OFF state, and an ON/OFF button
that starts out in the ON state. When used with the designed key_ids below this
becomes less significant since an OFF/ON button still reads ON in the variable's
ON state. The ON/OFF and OFF/ON buttons have two sets of bitmaps. One has text
that reads 'On' in green and 'Off' in red. The other is just a green/red light.
The buttons 'Key_Id_0_button..Key_Id_9_button' are not animated.
They have a text graphic '0'..'9'.
The buttons 'Hidden_Key_Id_0_button..Hidden_Key_Id_9_button' are invisible. Place
these like hotspots on your panel or over built-in background bitmap graphics.
The 'Switch' buttons operate in an opposite sense.
The down switch is OFF when down.
The up switch is OFF when up.
For any of the key_id buttons the parameter may be a negative number.
When negative the button becomes 'un-hooked' from the driving variable. It still
toggles the variable but is not driven by the variable. Every click on the button
will toggle the button and toggle the state of the variable with no regard to the
previous state. This can be useful for some odd conditions. Note that if
the variable is changed by another method, such as a hot key, the button with
a negative parameter will not reflect this change.
To select a parameter for the key_id, look in the list below for the variable
of interest and use the number from column 1 or column 2 in the parameter field.
Column 2 is simply the same number as in column 1 plus 65536.
NOTE: A parameter of 0 will result in a dummy button/switch that does nothing
but alternate state when clicked. The default parameter for key_id buttons is 0.
This could be used to place dummy switches on a panel.
Included within this archive is a file 'key_id.txt' which is a complete list of all
possible key_ids. Note that variables that are not boolean (toggles) will not work
well (if at all) with any of these buttons. The buttons in this gauge set can only
send a change state message to their respective variables and they can only respond
to an ON(not 0) or OFF(0) state returned by their variables.
The following are NOT RE-PROGRAMABLE
_____________________________________
RKG_buttons!AP_master_switch toggles the autopilot
RKG_buttons!FD_button toggles the flight director
RKG_buttons!NavGps_button toggles NAV/GPS autopilot feature
RKG_buttons!AutoStart_button starts all engines as with CTRL-E (not animated)
The following is a list of key_ids that are implemented with driving variables
by this gauge set.
Normally, only key_ids that are toggles are used by buttons but any
key_id can be used - the result just may not be useful.
These key_ids, when set in the parameter field, cause the button to be
driven by their appropriate variable. Any key_id can be used in the
parameter field but only those below allow the switch or button to
automatically respond to the state of the respective variable. A key_id
not in this list will still function but the button will be dumb, simply
switching between on and off. A dumb button will still act on the respective
variable but if the variable is changed through another method, such as
with a hot key or with another button, the dumb button will ignore that
change. The dumb button will still work but may be reversed in the ON/OFF
sense.
The key_ids implemented below also have an appropriate help pop-up implemented.
key_id - column 1 is the token number for the key_id
| column 2 is the internal number for the key_id ( = token number + 65536 )
| Either number may be used for the parameter.
|
|
|________
0 65536 KEY_ID_MIN
0 KEY_NULL (KEY_ID_MIN + 0)
TO INSTALL
__________
Unzip the file, RKG_buttons.gau, into your FS2000 gauges folder
or into your CFS2 gauges folder.
OR...
Unzip the zip file anywhere and move RKG_buttons.gau to your FS2000
(or CFS2) gauges folder.
A NOTE
______
I have done nothing slick in the code - it does not use FSUIPC or require any
special handling. The bitmaps may be modified in any way you like.
The up/down switch bitmaps in particular are fairly rough. The standard panel ident
button graphics now are not visually similar to those supplied by Microsoft.
They can be used instead of the Microsoft buttons or in addition to them. With no
parameter they will perform the same function as the standard buttons
and with a parameter they can extend the number of functions you can implement
in a single window. Of course, if you have the appropriate tools you can replace
the bitmaps with anything you like such as bitmaps more visually similar
to the standard MS gauges. This should only be attempted by persons familiar
with the structure of .DLL's and gauges and with appropriate program tools.
I will not give any more instructions or advice on how to do this.
If you believe this gauge is causing your FS2000 or CFS2 to fail
just stop using it. This gauge cannot do damage to your FS2000 installation.
Copyright 2001 Robert K. Guy.
You may not make money with this gauge in any way whatsoever but you
may freely distribute this gauge with any panel you design that is
exclusively freeware. You are also free to upload this gauge to any
other FS site that does not charge a fee for access or for downloads.